package com.example.cato_message_rabbitmq.message;


import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class MessageConfig {
    /*
    默认情况消息转换通过SimpleMessageConverter来实现的，他能将简单类和Serializable对象转换成Message对象，如果需要变更消息转换器，就要配置一个bean
     */
    @Bean
    public MessageConverter messageConverter() {
        return new Jackson2JsonMessageConverter();
    }
}
